package com.cityView.controller;

import com.cityView.entity.Vo.WeChatLoginRequest;
import com.cityView.service.impl.WeChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WeChatController {
    @Autowired
    private WeChatService weChatService;

    @PostMapping("/login")
    public String login(@RequestBody WeChatLoginRequest weChatLoginRequest) {
        String result = weChatService.getCode2Session(weChatLoginRequest.getCode());
        // 这里可以根据需要返回Token或者其他数据给前端
        return result;
    }


}
